<template>
	<view class="container">
		<view class="left">
			<image :src=imgUrl mode=""></image>
		</view>
		<view class="right">
			<view class="top">
				<view class="title"  @click="toDetail">
					<text>{{title}}</text>
				</view>
			</view>
			<view class="bottom">
				<view class="bt-left">
					<text class="author">{{author}}</text>
					<text class="time">{{time}}</text>
				</view>
				<view class="bt-right">
					<text class="read">阅读{{read}}</text>
					<text class="like">点赞 {{like}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			// 图片路径
			imgUrl:{
				type:String,
				default:"../static/homeImg/1.jpg"
			},
			// 标题名称
			title:{
				type:String,
				default:""
			},
			// 作者名称
			author:{
				type:String,
				default:""
			},
			// 更新时间
			time:{
				type:String,
				default:""
			},
			// 阅读次数
			read:{
				type:Number,
				default:100
			},
			// 点赞次数
			like:{
				type:Number,
				default:100
			}
		},
		data() {
			return {

			}
		},
		methods:{
			// 跳转到详情页面
			toDetail(){
				uni.navigateTo({
					url:"/pages/cyclopedia/cyclopediaDetail"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		display: flex;
		margin: 20rpx 0;
		.left{
			margin-right: 20rpx;
			image{
				width: 200rpx;
				height: 200rpx;
				border-radius: 10rpx;
			}
		}
		.right{
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.top{
				font-size: 28rpx;
				font-weight: bold;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 2;
				overflow: hidden;
			}
			.bottom{
				font-size: 24rpx;
				color: #C0C0C0;
				display: flex;
				align-items: center;
				justify-content: space-between;
				.author{
					margin-right: 10rpx;
				}
				.time{
					margin-right: 10rpx;
				}
				.read{
					margin-right: 10rpx;
				}
			}
		}
	}
</style>
